package leetcode.code994.RottingOranges;

import leetcode.helper.HelpDebug;

public abstract class RottingOranges implements IRottingOranges {

	@Override
	public void debug1() {
		int[][] input = new int[][] { { 2, 1, 1 }, { 1, 1, 0 }, { 0, 1, 1 } };
		int expect = 4;
		HelpDebug.printInputs(expect, input);
		int result = this.orangesRotting(input);
		HelpDebug.printObject(result);
	}

	@Override
	public void debug2() {
		int[][] input = new int[][] { { 2, 1, 1 }, { 0, 1, 1 }, { 1, 0, 1 } };
		int expect = -1;
		HelpDebug.printInputs(expect, input);
		int result = this.orangesRotting(input);
		HelpDebug.printObject(result);
	}

	@Override
	public void debug3() {
		int[][] input = new int[][] { { 0, 2 } };
		int expect = 0;
		HelpDebug.printInputs(expect, input);
		int result = this.orangesRotting(input);
		HelpDebug.printObject(result);
	}

	@Override
	public void debug4() {
//		[[2,0,1,1,1,1,1,1,1,1],[1,0,1,0,0,0,0,0,0,1],[1,0,1,0,1,1,1,1,0,1],[1,0,1,0,1,0,0,1,0,1],[1,0,1,0,1,0,0,1,0,1],[1,0,1,0,1,1,0,1,0,1],[1,0,1,0,0,0,0,1,0,1],[1,0,1,1,1,1,1,1,0,1],[1,0,0,0,0,0,0,0,0,1],[1,1,1,1,1,1,1,1,1,1]]
		int[][] input = new int[][] { { 2, 0, 1, 1, 1, 1, 1, 1, 1, 1 }, { 1, 0, 1, 0, 0, 0, 0, 0, 0, 1 },
				{ 1, 0, 1, 0, 1, 1, 1, 1, 0, 1 }, { 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 }, { 1, 0, 1, 0, 1, 0, 0, 1, 0, 1 },
				{ 1, 0, 1, 0, 1, 1, 0, 1, 0, 1 }, { 1, 0, 1, 0, 0, 0, 0, 1, 0, 1 }, { 1, 0, 1, 1, 1, 1, 1, 1, 0, 1 },
				{ 1, 0, 0, 0, 0, 0, 0, 0, 0, 1 }, { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 } };
		int expect = 58;
		HelpDebug.printInputs(expect, input);
		int result = this.orangesRotting(input);
		HelpDebug.printObject(result);
	}

	@Override
	abstract public int orangesRotting(int[][] grid);

}
